[XEN][POWERPC] Boot Module freeing
authorJimi Xenidis <jimix@watson.ibm.com>
Fri, 18 Aug 2006 09:39:01 +0000 (05:39 -0400)
committerJimi Xenidis <jimix@watson.ibm.com>
Fri, 18 Aug 2006 09:39:01 +0000 (05:39 -0400)
 - Fix bad logic that frees the modules anyway.
 - Allow for the absence of a Dom0 to continue execution until it's
   time to load it, useful for debugging bringup code.

Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
xen/arch/powerpc/domain_build.c
xen/arch/powerpc/setup.c

index 8c896aa1acdddf3188939adb7282de8bb56f687b..2cc93d58eb0704fafa76080182de0ab9ae74d0b1 100644 (file)
@@ -118,13 +118,18 @@ int construct_dom0(struct domain *d,
     BUG_ON(d->domain_id != 0);
     BUG_ON(d->vcpu[0] == NULL);
 
+    if (image_len == 0)
+        panic("No Dom0 image supplied\n");
+
     cpu_init_vcpu(v);
 
     memset(&dsi, 0, sizeof(struct domain_setup_info));
     dsi.image_addr = image_start;
     dsi.image_len  = image_len;
 
+    printk("Trying Dom0 as 64bit ELF\n");
     if ((rc = parseelfimage(&dsi)) != 0) {
+        printk("Trying Dom0 as 32bit ELF\n");
         if ((rc = parseelfimage_32(&dsi)) != 0)
             return rc;
         am64 = 0;
index 48978dd9dbbf5096e2f308319fbec0e304cb45d3..21782178dbadfa994e7a88c40da5cb71043d4563 100644 (file)
@@ -326,6 +326,9 @@ static void __init __start_xen(multiboot_info_t *mbi)
     for (i = 0; i < mbi->mods_count; i++) {
         u32 s;
 
+        if(mod[i].mod_end == mod[i].mod_start)
+            continue;
+
         s = ALIGN_DOWN(mod[i].mod_start, PAGE_SIZE);
 
         if (mod[i].mod_start > (ulong)_start &&
@@ -337,7 +340,9 @@ static void __init __start_xen(multiboot_info_t *mbi)
         if (s < freemem) 
             panic("module addresses must assend\n");
 
-        freemem = free_xenheap(freemem, s);
+        free_xenheap(freemem, s);
+        freemem = ALIGN_UP(mod[i].mod_end, PAGE_SIZE);
+        
     }
 
     /* the rest of the xenheap, starting at the end of modules */